%求向量的1范数,2范数,无穷范数,负无穷范数
X=[1,2,-2,3];
%向量X的范数
X=[1 2 -2 3];X1=norm(X,2),X2=norm(X,2),
Xw=norm(X,inf),Xfw=norm(X,-inf)
%求矩阵的1范数,2范数,无穷范数,负无穷范数
A=[11,2,3,4;7,-2,-3,-4;0.1,0.2,0.3,0.5;5,7,8,9]
%矩阵A的范数
A=[11,2,3,4;7,-2,-3,-4;0.1,0.2,0.3,0.5;5,7,8,9]
Ac1=cond(A,1),Ac2=cond(A,2),Acw=cond(A,inf),
Acfw=cond(A,'fro')>> norm_calculation
X1 =
4.2426
X2 =
4.2426
Xw =
3
Xfw =
1
A =
11.0000 2.0000 3.0000 4.0000
7.0000 -2.0000 -3.0000 -4.0000
0.1000 0.2000 0.3000 0.5000
5.0000 7.0000 8.0000 9.0000
A =
11.0000 2.0000 3.0000 4.0000
7.0000 -2.0000 -3.0000 -4.0000
0.1000 0.2000 0.3000 0.5000
5.0000 7.0000 8.0000 9.0000
Ac1 =
924.0000
Ac2 =
440.4564
Acw =
690.2000
Acfw =
522.5128
求向量和矩阵的范数
最新推荐文章于 2024-08-08 23:23:23 发布